//
//  NSDate+Helper.h
//  Oscar
//
//  Created by cqck on 2018/4/17.
//  Copyright © 2018年 cqck. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSDate (Helper)

+ (NSDate *)gmtDate;

+ (NSInteger)weekDay;

+ (NSInteger)previousWithDayNumber:(NSInteger)number;

+ (NSString *)previousDay;

+ (NSInteger)nextWithDayNumber:(NSInteger)number;

+ (NSInteger)nowDay;

///时间对比
+ (NSInteger)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay withFormat:(NSString *)format;

+ (NSString *)convertTimeWithDate:(NSString *)format time:(CGFloat)time;

+ (NSString *)convertTimeWithFormat:(NSString *)format time:(NSString *)timeStr;

///将NSdate转换成相应格式的字符串
+ (NSString *)convertDate:(NSDate *)date format:(NSString *)format;

///将时间字符串转换为NSdate
+ (NSDate *)covnertStrTime:(NSString *)time format:(NSString *)format;

+ (NSDate *)timePlusNextSecond:(NSDate *)time second:(NSInteger)second;

///将字符串时间转换为NSDate类型
+ (NSArray<NSNumber *> *)convertBeginTime:(NSString *)begintime endTime:(NSString *)endTime format:(NSString *)format;

+ (NSDate *)convertDate:(CGFloat)time;

+ (NSDate *)convertLocalDataByGMT:(NSDate *)date;

+(NSArray *)getFirstAndLastDayOfThisMonthWith:(NSDate *)date;

+ (NSInteger)getNowTimestampWithFormat:(NSString *)format;

+ (NSInteger)nowTimestampWithTime:(NSInteger)timstamp andFormatter:(NSString *)format nowDate:(NSDate *)nowDate;

///将时间戳转换为时间字符串
+ (NSString *)convertTimestamp:(NSInteger)timstamp andFormatter:(NSString *)format;

- (NSString *)stringWithFormat:(NSString *)format;

@end
